package com.img.demo01.goods.controller;

import com.img.demo01.goods.mapper.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Arrays;

@Controller
@RequestMapping("/goods/")
public class GoodsController {

    @Autowired
    private GoodsMapper goodsMapper;

    @RequestMapping("doGoodsUI")
    public String doGoodsUI(){
        return "goods";
    }

    @RequestMapping("doDeleteObjects")
    @ResponseBody
    public String doDeleteObjects(Integer... ids){
        int rows = goodsMapper.deleteObjects(ids);
        return "delete ok rows=" + rows;
    }
}